package com.sword.pay.example.config;

import com.sword.pay.alipay.domain.config.AliPayConfig;
import com.sword.pay.repository.config.ISPayClientConfig;
import org.noear.solon.annotation.*;

/**
 * @description: 配置类，注入bean
 * @author：Lv.RJ
 * @version: 1.0.0
 * @create: 2025/02/17
 **/
@Configuration
public class Config {
    @Bean
    public ISPayClientConfig aliPayConfig(){
        return AliPayConfig.builder()
                .setAppId("aliPayBean.getAppId()")
                .setAliPayPublicKey("aliPayBean.getPublicKey()")
                .setAppCertPath("aliPayBean.getAppCertPath()")
                .setAliPayCertPath("aliPayBean.getAliPayCertPath()")
                .setAliPayRootCertPath("aliPayBean.getAliPayRootCertPath()")
                .setCharset("UTF-8")
                .setPrivateKey("aliPayBean.getPrivateKey()")
                .setServiceUrl("aliPayBean.getServerUrl()")
                .setSignType("RSA2");

        // 证书模式
//                .buildByCert();
    }
}
